<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>frame</title>
<link type="text/css" rel="stylesheet" href="<?php echo MY_URL;?>/css/style.css?v=2012122312"/>
<style>
#timer .f-iblk{
	padding:5px 5px;
	background-color:#B20000;
	color:#fff;
}
</style>
</head>

<body style="background:none;width:220px;">

<?php if(count($this->items)>0):?>
<div class="w-blk0 w-blk-ltbox">
    <h2 class="blk0h2 f-iblk clearfix">
    	<span class="spbg blkhdl">Gaga Deals</span>
        <span class="spbg blkhdr">&nbsp;</span>
    </h2>
    <div class="blkbody">
    	<div id="timer">
	    	<div style="text-align:center;margin:10px 0px;font-weight:bold;font-size:15px;"><?php if($this->timeType == 'start'):?>GAGA Deal will start in:<?php else:?>GAGA Deal will end in:<?php endif;?></div>
	    	<div style="text-align:center;margin:10px 0px;font-weight:bold;font-size:15px;"><span id="hour" class="f-iblk"></span> : <span id="min" class="f-iblk"></span> : <span id="sec" class="f-iblk"></span></div>
	    </div>
        <ul class="clearfix">
        <?php foreach ($this->items as $v):?>
             <li>
                <div class="prd simg"><img alt="<?php echo $v['subject'];?>" title="<?php echo $v['subject'];?>" src="<?php echo MY_URL?>/<?php echo $v['cut_url'];?>"></div>
                <div class="prd spname"><a target="_parent" href="<?php echo $this->url($v['itemid']);?>" title="<?php echo $v['subject'];?>"><?php echo $v['subject'];?></a></div>
                <div class="prd sprice"><a target="_parent" class="spbg f-iblk priceA" href="<?php echo $this->url($v['itemid']);?>" title="<?php echo $v['subject'];?>">Price <span class="delete">$<?php echo $v['m_org_price'];?></span> <strong>$<?php echo $v['max_price'];?></strong></a></div>
                <div><a target="_parent" class="f-blk pboxbar spbg" href="<?php echo $this->url($v['itemid']);?>">&nbsp;</a></div>
                <a target="_parent" href="<?php echo $this->url($v['itemid']);?>" class="discount-prd f-iblk"><?php echo intval(($v['m_org_price']-$v['max_price'])/$v['m_org_price']*100) ?>%</a>
            </li>
       	<?php endforeach;?>
        </ul>
    </div>
</div>
<?php else:?>
<div class="w-blk0 w-blk-ltbox">
    <h2 class="blk0h2 f-iblk clearfix">
    	<span class="spbg blkhdl">Gaga Deals</span>
        <span class="spbg blkhdr">&nbsp;</span>
    </h2>
    <div class="blkbody">
    	<div id="timer">
	    	<div style="text-align:center;margin:10px 0px;font-weight:bold;font-size:15px;"><?php if($this->timeType == 'start'):?>GAGA Deal will start in:<?php else:?>GAGA Deal will end in:<?php endif;?></div>
	    	<div style="text-align:center;margin:10px 0px;font-weight:bold;font-size:15px;"><span id="hour" class="f-iblk"></span> : <span id="min" class="f-iblk"></span> : <span id="sec" class="f-iblk"></span></div>
	    </div>
        <ul class="clearfix">
	        <li>
	            <div class="prd simg"><img src="<?php echo MY_URL?>/images/flashimg.jpg"></div>
	            <div class="prd spname"><a href="<?php echo MY_URL;?>/flash-index">Guess what's this</a></div>
	            <div class="prd sprice"><a target="_parent" class="spbg f-iblk priceA" href="<?php echo MY_URL;?>/flash-index">Price <strong>$19.99</strong></a></div>
	            <div><a target="_parent" class="f-blk pboxbar spbg" href="<?php echo MY_URL;?>/flash-index">&nbsp;</a></div>
	        </li>
	        <li>
	            <div class="prd simg"><img src="<?php echo MY_URL?>/images/flashimg.jpg"></div>
	            <div class="prd spname"><a href="<?php echo MY_URL;?>/flash-index">Guess what's this</a></div>
	            <div class="prd sprice"><a target="_parent" class="spbg f-iblk priceA" href="<?php echo MY_URL;?>/flash-index">Price <strong>$19.99</strong></a></div>
	            <div><a target="_parent" class="f-blk pboxbar spbg" href="<?php echo MY_URL;?>/flash-index">&nbsp;</a></div>
	        </li>
	        <li>
	            <div class="prd simg"><img src="<?php echo MY_URL?>/images/flashimg.jpg"></div>
	            <div class="prd spname"><a href="<?php echo MY_URL;?>/flash-index">Guess what's this</a></div>
	            <div class="prd sprice"><a target="_parent" class="spbg f-iblk priceA" href="<?php echo MY_URL;?>/flash-index">Price <strong>$19.99</strong></a></div>
	            <div><a target="_parent" class="f-blk pboxbar spbg" href="<?php echo MY_URL;?>/flash-index">&nbsp;</a></div>
	        </li>
	        <li>
	            <div class="prd simg"><img src="<?php echo MY_URL?>/images/flashimg.jpg"></div>
	            <div class="prd spname"><a href="<?php echo MY_URL;?>/flash-index">Guess what's this</a></div>
	            <div class="prd sprice"><a target="_parent" class="spbg f-iblk priceA" href="<?php echo MY_URL;?>/flash-index">Price <strong>$19.99</strong></a></div>
	            <div><a target="_parent" class="f-blk pboxbar spbg" href="<?php echo MY_URL;?>/flash-index">&nbsp;</a></div>
	        </li>
        </ul>
    </div>
</div>
<?php endif;?>
<script>
var _leftTime = <?php echo $this->leftTime;?>;
var sec = document.getElementById("sec");
var min = document.getElementById("min");
var hour = document.getElementById("hour");
setInterval(function(){
	if(_leftTime == 0){
		window.location.reload();window.location.href=window.location.href;
	}else{
		_leftTime--;
		var _sec = _leftTime%60;
		if(_sec<10){
			_sec = '0'+_sec.toString();
		}
		var _min = parseInt((_leftTime-(parseInt(_leftTime/3600))*3600)/60);
		if(_min<10){
			_min = '0'+_min.toString();
		}
		var _hour = parseInt(_leftTime/3600);
		if(_hour<10){
			_hour = '0'+_hour.toString();
		}
		
		sec.innerHTML = _sec;
		min.innerHTML = _min;
		hour.innerHTML = _hour;
	}
},1000);
</script>
</body>
</html>
